package com.ruoyi.system.domain.bo;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;


/**
 * 租户业务对象 sys_tenant
 *
 * @author ace
 * @date 2022-10-10
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class SysTenantBo extends BaseEntity {

    /**
     * 租户id
     */
    @NotNull(message = "租户id不能为空", groups = { EditGroup.class })
    private Long tenantId;

    /**
     * 租户名称
     */
    @NotBlank(message = "租户名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String tenantName;

    /**
     * 管理用户登录名称
     */
    @NotNull(message = "管理用户登录名称不能为空", groups = { AddGroup.class })
    @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成")
    @Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符")
    private String userName;

    /**
     * 管理用户登录密码
     */
    @NotNull(message = "管理用户登录密码不能为空", groups = { AddGroup.class })
    @Length(min = 4, max = 16, message = "密码长度为 4-16 位")
    private String password;

    /**
     * 联系人姓名
     */
    private String contactName;

    /**
     * 联系人电话
     */
    private String contactMobile;

    /**
     * 租户状态（0正常 1停用）
     */
    private String status;

    /**
     * 绑定域名
     */
    private String domain;

    /**
     * 租户套餐id
     */
    @NotNull(message = "租户套餐id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long packageId;

    /**
     * 过期时间
     */
    @NotNull(message = "过期时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date expireTime;

    /**
     * 账号数量
     */
    @NotNull(message = "账号数量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long accountCount;


}
